All Functions Used So Far, Week 3

log

{base}

log (default base = e)

tibble

{tibble}

A modern data frame from the tidyverse

order

{base}

Get indexes that will sort a vector

group_tt

{tinytable}

Grouping in tinytable

library

{base}

Load an R package

list

{base}

Create a list object

is.na

{base}

Check if a value is NA/elements of vector are NA

pnorm

{base}

Returns the cumulative distribution function (CDF) of the normal distribution

par

{graphics}

Set parameters of the plotting device

ggsave

{ggplot2}

Saves the last ggplot or a specified ggplot object to a file

ifelse

{base}

Return a or b depending on the value of test

setwd

{base}

Set Working Directory

var

{stats}

Calculate variance

filter

{dplyr}

Filter out rows of a data frame according to logical vector

sd

{stats}

Get standard deviation of a vector

mutate

{dplyr}

Modify/create a column in a data frame

dnorm

{stats}

Density distribution for the normal distribution

mean

{base}

Get mean of a vector

rnorm

{base}

Generate random numbers from a normal distribution

seq

{base}

Create a sequence

str

{utils}

Get the structure of an R object

bar

{base}

Used for annotations, such as “expression(paste(”-“,bar(y)))”

names

{base}

Retrieve names of a list/vector

plot

{graphics}

Generic function from base R to produce a plot

as.data.frame

{base}

Functions to check if an object is a data frame, or coerce it if possible.

read_excel

{readxl}

Read an Excel file

binomial

{base}

Family argument in glm()

min

{base}

Get minimum of a vector

c

{base}

Combine values/vectors into a vector

nrow

{base}

Get number of rows of a data frame

head

{utils}

Show first 5 rows of a data frame

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

arrange

{dplyr}

Sort values of data frame according to a variable/combination of varaibles

cut

{base}

Convert Numeric to Factor

length

{base}

Returns number of elements in an object

expression

{base}

Used in plots to add symbols to axes

data.frame

{base}

Create a data.frame from vectors

range

{base}

Return range of values

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

lm

{base}

Fit a linear model

as.character

{base}

Coerce a vector to character

sample

{base}

Takes a sample of the specified size

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

summary

{base}

Obtain summary statistics or detailed regression output

median

{stats}

Get median of a vector

which

{base}

return indexes of TRUE entries of a logical vector

modelsummary

{modelsummary}

Creates regression and data tables

glm

{base}

Fits generalized linear models

ordered

{dplyr}

Create an ordered factor

ungroup

{dplyr}

Resolve grouping created with “group_by”

predict

{stats}

Predict Probability

max

{base}

Get maximum of a vector

nobs

{gdata}

Compute the number of non-missing observations

The end!